﻿using System;
using System.Runtime.InteropServices;

namespace Ast.Core.WinApi
{
    public class Structure
    {
        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct SecurityAttributes
        {
            public uint nLength;

            public IntPtr lpSecurityDescriptor;

            public bool bInheritHandle;
        }


        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct Overlapped
        {
            public uint Internal;

            public uint InternalHigh;

            public uint Offset;

            public uint OffsetHigh;

            public IntPtr hEvent;
        }


        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct ServiceStatus
        {
            public uint dwServiceType;

            public uint dwCurrentState;

            public uint dwControlsAccepted;

            public uint dwWin32ExitCode;

            public uint dwServiceSpecificExitCode;

            public uint dwCheckPoint;

            public uint dwWaitHint;
        }


        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct KeyboardInputData
        {
            public ushort UnitId;

            public ushort MakeCode;

            public ushort Flags;

            public ushort Reserved;

            public ulong ExtraInformation;
        }

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct UnicodeString
        {
            public ushort Length;

            public ushort MaximumLength;

            public IntPtr Buffer;
        }

        [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)]
        public struct ListEntry
        {
            public IntPtr Flink;

            public IntPtr Blink;
        }
    }
}